package br.com.threads;

class Test implements Runnable{
	public void run(){
		synchronized (this) {
			for(int i = 0; i <= 100; i++){
				if(i % 2 == 0){
					System.out.print(i + " " + "\n");
				}
				notify();
			}
		}		
	}
}
public class Programa34 {
	public static void main(String[] args) {
		Test test = new Test();
		new Thread(test).start();
		synchronized (test) {
			try{
				System.out.println("Aguardando Test Finalizar....");
				test.wait();
				System.out.println("Finalizado");
			}catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
